package com.niuxiaofa.newlaw.View;

import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

import com.niuxiaofa.newlaw.R;


public class LoadingDialog extends AlertDialog {
    private String msg;
    private TextView tv_loading_dialog_name;

    public LoadingDialog(Context context) {
        this(context, R.style.AlertDialog);
    }

    public LoadingDialog(Context context, int i) {
        super(context, i);
    }

    protected LoadingDialog(Context context, boolean z, OnCancelListener onCancelListener) {
        super(context, z, onCancelListener);
    }

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.dialog_loading);
        this.setCanceledOnTouchOutside(false);//点击空白处，窗体不关闭
        this.setCancelable(false);
        this.tv_loading_dialog_name = findViewById(R.id.tv_loading_dialog_aaaaa);
        if (this.msg != null) {
            this.tv_loading_dialog_name.setText(msg);
        } else {
            this.tv_loading_dialog_name.setText("加载中...");
        }
    }

    public void setText(String str) {
        this.msg = str;
        if (this.tv_loading_dialog_name != null) {
            this.tv_loading_dialog_name.setText(str);
        }
    }
}
